import { mode } from "@/routes";
import { sendChannelMessage } from "./childChanel";
import { Channel } from "./channel";
export const openChildWindow = (path: string) => {
  const url = `${window.location.origin}${mode.base}${path}`;
  window.open(url, Channel.channelEnum[path].name)!;
};
export const closeChildWindow = () => {
  Object.keys(Channel.channelEnum).forEach((WindowName) =>
    sendChannelMessage(WindowName)
  );
};
